<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center returnedPage_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub returnedPage_fd0_0'>
          <view class='flex flex-wrap align-center returnedPage_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  returnedPage_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='returnedPage_fd0_0_c1_c0'>待归还</text>
          </view>
          <view class='flex flex-wrap align-center justify-end returnedPage_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout returnedPage_flex_3">
        <benben-select-diy ref="showSelectPopup1698285824921" class-name='flex flex-direction align-stretch flex'
          :items.sync="completedList" v-model="type_value" :label.sync="type_label" default-type="aid"
          default-label="goods_name" :allow-cancel='true' type="checkbox" :disabled='false' :max-select="-1"
          @change="changeSelect">
          <template v-for='(item,key0) in completedList'>
            <view v-if="item.isSelected" class='flex flex-direction align-stretch flex returnedPage_fd3_0_c0'
              :key="key0" @tap="$refs.showSelectPopup1698285824921.tapHandle(key0)">
              <view class='flex flex-wrap align-center returnedPage_fd3_0_c0_c0'>
                <image class='returnedPage_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"82.png"'></image>
                <view class='flex flex-wrap align-center returnedPage_fd3_0_c0_c0_c1'>
                  <image class='returnedPage_fd3_0_c0_c0_c1_c0' mode="aspectFill" :src='item.goods_thumb'></image>
                  <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                    <view class='text-cut returnedPage_fd3_0_c0_c0_c1_c1_c0'>{{item.goods_name}}</view>
                    <view class='flex flex-wrap align-center returnedPage_fd3_0_c0_c0_c1_c1_c1'>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c1_c0' v-for="(itemC,indexC) in item.category_name"
                        v-if="item.category_name.length&& indexC<2">{{itemC}}</text>
                      <!-- <text class='returnedPage_fd3_0_c0_c0_c1_c1_c1_c1'>二级分类</text> -->
                    </view>
                    <view class='flex flex-wrap align-center'>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c2_c0'>{{item.shop_price}}</text>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c2_c1'>积分</text>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c2_c2'>x{{item.num}}</text>
                    </view>
                  </view>
                </view>
              </view>
              <view class='flex flex-wrap align-center justify-end returnedPage_fd3_0_c0_c1'>
                <button class='returnedPage_fd3_0_c0_c1_c0'>申请归还</button>
              </view>
            </view>
            <view v-else class='flex flex-direction align-stretch flex returnedPage_fd3_0_c0' :key="key0"
              @tap="$refs.showSelectPopup1698285824921.tapHandle(key0)">
              <view class='flex flex-wrap align-center returnedPage_fd3_0_c0_c0'>
                <image class='returnedPage_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"83.png"'></image>
                <view class='flex flex-wrap align-center returnedPage_fd3_0_c0_c0_c1'>
                  <image class='returnedPage_fd3_0_c0_c0_c1_c0' mode="aspectFill" :src='item.goods_thumb'></image>
                  <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                    <view class='text-cut returnedPage_fd3_0_c0_c0_c1_c1_c0'>{{item.goods_name}}</view>
                    <view class='flex flex-wrap align-center returnedPage_fd3_0_c0_c0_c1_c1_c1'>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c1_c0' v-for="(itemC,indexC) in item.category_name"
                        v-if="item.category_name.length&& indexC<2">{{itemC}}</text>
                      <!-- <text class='returnedPage_fd3_0_c0_c0_c1_c1_c1_c1'>二级分类</text> -->
                    </view>
                    <view class='flex flex-wrap align-center'>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c2_c0'>{{item.shop_price}}</text>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c2_c1'>积分</text>
                      <text class='returnedPage_fd3_0_c0_c0_c1_c1_c2_c2'>x{{item.num}}</text>
                    </view>
                  </view>
                </view>
              </view>
              <view class='flex flex-wrap align-center justify-end returnedPage_fd3_0_c0_c1'>
                <button class='returnedPage_fd3_0_c0_c1_c0'>申请归还</button>
              </view>
            </view>
          </template></benben-select-diy>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex returnedPage_flex_4"
        v-if="completedList.length">
        <view class='flex flex-wrap align-center justify-between flex-sub returnedPage_fd4_0'>
          <view class='flex flex-wrap align-center'>
            <text class='returnedPage_fd4_0_c0_c0'>已选择</text>
            <text class='returnedPage_fd4_0_c0_c1'>{{chooseRr.length}}</text>
            <text class='returnedPage_fd4_0_c0_c0'>件</text>
          </view>
          <button class='returnedPage_fd4_0_c1' @tap.stop="applyReturnFunc">确认归还</button>
        </view>

      </view>
      <view :style="{height: '100rpx'}"></view>


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "popupShow1697595462878": false,
        "popupShow1697595527069": false,
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "apply": "2",
        "type_value": "",
        "type_label": "",
        "pickedList": [],
        "completedList": [],
        "order": "",
        "is_pickup": "3",
        chooseRr: []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.getListFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      changeSelect() {
        this.chooseRr = this.type_value.split(',')
        console.log('1111', this.chooseRr.length)

      },
      async applyReturnFunc() {

        let data6527c6533f22f = await this.$api.post(global.apiUrls.post6527c6533f22f, {
          aid: this.type_value
        });

        if (data6527c6533f22f.data.code != 1) {
          this.$message.info(data6527c6533f22f.data.msg);
          return
        }
        this.$message.info(data6527c6533f22f.data.msg);
        this.getListFunc()
      },

      //申请归还
      applyForreturnFunc() {
        if (this.apply == '1') {
          this.apply = '2';
        } else if (this.apply == '2') {
          this.apply = '1';
        }
      },
      //获取各种列表
      getListFunc() {
        this.minixPagingListsApi = global.apiUrls.post6527c4de3fc5a;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          order_status: 1
        }
        this.listData = [];
        this.completedList = this.listData;
        this.pagingListToggle();
      },
      //取消订单
      cancellationOrderFunc(order_sn) {
        this.order = order_sn;
        this.popupShow1697595527069 = true;
      },
      //确认取消订单
      async confirmCancelFunc() {
        //请求方法
        //数据验证

        let data62b9285cb2e0d = await this.$api.get(global.apiUrls.post62b9285cb2e0d, {
          order_sn: this.order
        });

        if (data62b9285cb2e0d.data.code != 1) {
          this.$message.info(data62b9285cb2e0d.data.msg);
          return
        }


        this.popupShow1697595527069 = false;
        this.getListFunc()
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: url(https://api.nongjugongxiang.com/nongju/images/61.png) no-repeat, #F8F8F8;
    background-size: 100% auto;
  }

  .returnedPage_flex_0 {
    background: url(https://api.nongjugongxiang.com/nongju/images/61.png) no-repeat;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .returnedPage_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #FFFFFF;
  }

  .returnedPage_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: var(--benbenFontColor3);
  }

  .returnedPage_fd0_0_c0 {
    width: 120rpx;
  }

  .returnedPage_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .returnedPage_flex_1 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 64rpx 74rpx 48rpx 74rpx;
  }

  .returnedPage_fd1_1_c1 {
    background: #E63838;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    font-size: 28rpx;
    color: var(--benbenFontColor3);
    margin: 0rpx 0rpx 0rpx 12rpx;
    width: 176rpx;
    height: 72rpx;
  }

  .returnedPage_fd1_1_c0 {
    background: #F8F8F8;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    font-size: 28rpx;
    color: var(--benbenFontColor0);
    margin: 0rpx 12rpx 0rpx 0rpx;
    width: 176rpx;
    height: 72rpx;
  }

  .returnedPage_fd1_0 {
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
    margin: 0rpx 0rpx 56rpx 0rpx;
  }

  .returnedPage_flex_2 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 64rpx 74rpx 48rpx 74rpx;
  }

  .returnedPage_fd2_1_c1 {
    background: #E63838;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    font-size: 28rpx;
    color: var(--benbenFontColor3);
    padding: 0rpx 61rpx 0rpx 61rpx;
    margin: 0rpx 0rpx 0rpx 12rpx;
    width: 176rpx;
    height: 72rpx;
  }

  .returnedPage_fd2_1_c0 {
    background: #F8F8F8;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    font-size: 28rpx;
    color: var(--benbenFontColor0);
    padding: 0rpx 61rpx 0rpx 61rpx;
    margin: 0rpx 12rpx 0rpx 0rpx;
    width: 176rpx;
    height: 72rpx;
  }

  .returnedPage_fd2_0 {
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
    margin: 0rpx 0rpx 56rpx 0rpx;
  }

  .returnedPage_flex_3 {
    padding: 24rpx 24rpx 0rpx 24rpx;
  }

  .returnedPage_fd3_0_c0_c1_c0 {
    background: #E63838;
    border-radius: 32rpx 32rpx 32rpx 32rpx;
    width: 160rpx;
    line-height: 64rpx;
    font-size: 28rpx;
    color: #fff;
    height: 64rpx;
  }

  .returnedPage_fd3_0_c0_c1 {
    padding: 32rpx 30rpx 32rpx 0rpx;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c2_c2 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c2_c1 {
    color: rgba(230, 56, 56, 1);
    font-size: 24rpx;
    font-weight: 700;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c2_c0 {
    color: rgba(230, 56, 56, 1);
    font-size: 36rpx;
    font-weight: 700;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c1_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c1 {
    margin: 0rpx 0rpx 55rpx 0rpx;
  }

  .returnedPage_fd3_0_c0_c0_c1_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    margin: 0rpx 0rpx 24rpx 0rpx;
    width: 380rpx;
  }

  .returnedPage_fd3_0_c0_c0_c1_c0 {
    width: 200rpx;
    height: 200rpx;
    margin: 0rpx 12rpx 0rpx 0rpx;
  }

  .returnedPage_fd3_0_c0_c0_c1 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .returnedPage_fd3_0_c0_c0_c0 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .returnedPage_fd3_0_c0_c0 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 24rpx;
  }

  .returnedPage_fd3_0_c0 {
    background: rgba(255, 255, 255, 1);
    margin: 0rpx 0rpx 24rpx 0rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
  }

  .returnedPage_flex_4 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 100rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto;
  }

  .returnedPage_fd4_0_c1 {
    background: rgba(230, 56, 56, 1);
    border-radius: 40rpx;
    width: 258rpx;
    line-height: 80rpx;
    font-size: 28rpx;
    color: #fff;
  }

  .returnedPage_fd4_0_c0_c1 {
    color: rgba(230, 56, 56, 1);
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .returnedPage_fd4_0_c0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .returnedPage_fd4_0 {
    padding: 0rpx 24rpx 0rpx 24rpx;
  }
</style>
